import VueRouter from 'vue-router'
import shoy from './components/tabbar/shoy.vue'
import message from './components/tabbar/message.vue'
import shop from './components/tabbar/shop.vue'
import myhome from './components/tabbar/myhome'
import page from './components/goodspage/page.vue'
import shoyreco from './components/shoytj/shoyreco.vue'
import recot from './components/shoytj/recot.vue'
import burst from './components/shoytj/burst.vue'
import selling from './components/shoytj/selling.vue'
import goodstjpage from './components/shoytj/goodstjpage.vue'
import goodsjs from './components/childcom/goodsjs.vue'
import goodsgg from './components/childcom/goodsgg.vue'
import goodsbz from './components/childcom/goodsbz.vue'
import subord from './components/homechile/subord.vue'

const router = new VueRouter({ //创建路由实例
    routes: [   //定义路由
        {path: '/', redirect: '/shoy'},
        {path: '/shoy', component: shoy,
            children: [
                {path: '/', redirect: 'recot'},
                {path: 'recot', component: recot},
                {path: 'shoyreco', component: shoyreco},
                {path: 'burst', component: burst},
                {path: 'selling', component: selling}
            ]
        },   
        {path: '/message', component: message},
        {path: '/shop', component: shop},
        {path: '/myhome', component: myhome},
        {path: '/shoy/page', component: page},
        {path: '/shoy/page/goodstjpage/:id/:name/:jg/:urlimg', component: goodstjpage,
            children: [
                {path: '/', redirect: 'goodsjs'},
                {path: 'goodsjs', component: goodsjs},
                {path: 'goodsgg', component: goodsgg},
                {path: 'goodsbz', component: goodsbz}
            ]
        },
        {path: '/shoy/reco/goodstjpage/:id/:name/:jg/:urlimg', component: goodstjpage,
            children: [
                {path: '/', redirect: 'goodsjs'},
                {path: 'goodsjs', component: goodsjs},
                {path: 'goodsgg', component: goodsgg},
                {path: 'goodsbz', component: goodsbz}
            ]
        },
        {path: '/shoy/orde', name: 'SubOrder', component: subord},
        {path: '/shoy/shop/orde', name: 'shoporder', component: subord}
    ],
    linkActiveClass: 'mui-active'   //把原来设置高亮的修改为自定义的类
})

export default router   //把路由对象暴露出去